<!DOCTYPE html>
<html lang="en">
{% load static %}
{% include 'api/header.html' %}

<body>
{% include 'api/nav-top.html' %}

<div class="container-fluid">
    <div class="row">
            {% include 'api/nav-left.html' %}
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
             <h1 class="page-header">任务</h1>
             <button type="button" class="btn btn-primary" id="btn-task-new">新建任务</button>
            <div class="table-responsive">
                <table class="table table-striped">
                    <thead>
                    <tr>
                        <th>任务名</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {% if task_list %}
                    {% for i in  task_list %}
                    <tr id="{{i.id}}">
                        <td>{{i.name}}</td>
                        <td>
                            <input type="button" class="btn btn-lg btn-primary btn-edit" value="编辑">
                            <input type="button"  class="btn btn-lg btn-primary btn-del" value="删除">
                            <a  class="btn btn-lg btn-primary btn-module" href="{% url 'api:task_module'  i.id %}"> 关联模块</a>
                            {% if i.extend == 1 %}
                                <button  class="btn btn-lg btn-primary btn-run" disabled="true"> 测试中</button>
                            {% elif i.extend == 2 %}
                                <button  class="btn btn-lg btn-primary btn-run"> 运行</button>
                            {% elif i.extend == 0 %}
                                <button  class="btn btn-lg btn-primary btn-run"> 运行</button>
                            {% endif %}
                        </td>
                    </tr>
                    {% endfor %}
                    {% else %}
                    <tr>
                        <td>无数据</td>
                    </tr>
                    {% endif %}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
{% include 'api/del.html' %}
{% include 'api/edit-task.html' %}
{% include 'api/alert.html' %}
{% include 'api/foot.html' %}
<script src="{% static  'js/common.js' %}"></script>
<script src="{% static  'js/task.js' %}"></script>

</body>
</html>